package com.fengjing.launcher.common;

import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.view.View;

import com.fengjing.launcher.activity.BaseActivity;
import com.fengjing.launcher.model.FilmModel;

/**
 * Created by admin on 2017/9/21.
 */

public class MyOnClickListener implements View.OnClickListener {

    private FilmModel filmModel;

    public MyOnClickListener(FilmModel filmModel) {
        this.filmModel = filmModel;
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        ComponentName componentName = new ComponentName("com.highglass.videoplayer", "com.highglass.videoplayer.VideoPlayActivity");
        intent.setComponent(componentName);

        intent.setData(Uri.parse(filmModel.getFilmPath()));
        intent.putExtra("movieName", filmModel.getFilmName());
        intent.putExtra("isVR", filmModel.isVR());
        intent.putExtra("is3D", filmModel.is3D());
        intent.putExtra("isEpisode", filmModel.isEpisode());
        intent.putExtra("imageUrl", BaseActivity.bgInfo.getBgPath());
        v.getContext().startActivity(intent);
    }
}
